package com.yanmaohu.yulia.bean;

import java.util.List;

/**
 * @author Bright Lee
 */
public final class ArrayValueExpression implements CollectionValueExpression {

    private int beginIndex;
    private int endIndex;
    private List<ValueExpressionPrimary> arrayFactorList;

    public ArrayValueExpression(List<ValueExpressionPrimary> arrayFactorList) {
        this.beginIndex = arrayFactorList.get(0).getBeginIndex();
        this.endIndex = arrayFactorList.get(arrayFactorList.size() - 1).getEndIndex();
        this.arrayFactorList = arrayFactorList;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public int size() {
        return arrayFactorList.size();
    }

    public ValueExpressionPrimary get(int index) {
        return arrayFactorList.get(index);
    }

}
